/*
 * @Author: caihongtai caihongtai
 * @Date: 2025-02-08 20:55:16
 * @LastEditors: caihongtai caihongtai
 * @LastEditTime: 2025-03-31 22:42:59
 * @FilePath: /ai-interview-vue/src/main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import store from './store'
// 注册 Vant 组件
import Vant from 'vant'
import 'vant/lib/index.css'
import typewriterDirective from '@/utils/typewriter'
import { vLoading } from '@/directives/loading'
import * as Sentry from "@sentry/vue";



const app = createApp(App);
Sentry.init({
    app,
    dsn: "https://95ab3412b66608aea7915f855c24f960@o395077.ingest.us.sentry.io/4509072801792000"
});
// 注册路由和状态管理
app.use(router)
app.use(store)
app.use(Vant)

app.mount('#app')
// 注册全局指令
app.directive('typewriter', typewriterDirective)
app.directive('loading', vLoading)

// 在生产环境中强制使用 HTTPS
if (import.meta.env.PROD && window.location.protocol === 'http:' && !window.location.hostname.includes('localhost')) {
    window.location.href = window.location.href.replace('http:', 'https:')
}